package com.huawei.hms.aaid.a;

import android.content.Context;
import android.text.TextUtils;
import com.huawei.hms.aaid.constant.AaidIdConstant.PUSH_CLIENT_SELF_INFO;
import com.huawei.hms.support.log.HMSLog;

public abstract class c {
    public static String a(Context context, String str) {
        String str2 = "";
        if (!TextUtils.isEmpty(str)) {
            try {
                str2 = d.b(context, new com.huawei.hms.aaid.c.c(context, str).a(PUSH_CLIENT_SELF_INFO.TOKEN_INFO));
            } catch (Exception e) {
                HMSLog.e("PushDataEncrypterManager", "getSecureData" + e.getMessage());
            }
            if (TextUtils.isEmpty(str2)) {
                HMSLog.d("PushDataEncrypterManager", "getSecureData not exist");
            }
        }
        return str2;
    }

    public static void b(Context context, String str) {
        if (!TextUtils.isEmpty(str)) {
            try {
                new com.huawei.hms.aaid.c.c(context, str).d(PUSH_CLIENT_SELF_INFO.TOKEN_INFO);
            } catch (Exception e) {
                HMSLog.e("PushDataEncrypterManager", "removeSecureData" + e.getMessage());
            }
        }
    }

    public static boolean a(Context context, String str, String str2) {
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        return new com.huawei.hms.aaid.c.c(context, str).a(PUSH_CLIENT_SELF_INFO.TOKEN_INFO, d.a(context, str2));
    }
}
